package com.wwdx.controller.admin;

import com.wwdx.model.WwdxMerchantProductStatisticsModel;
import com.wwdx.service.WwdxMerchantProductStatisticsServiceI;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * @author liguoliang
 * @date 2018/2/2 17:31
 */
@Controller
@RequestMapping("/system/wwdx_merchant_product_statistics")
public class WwdxMerchantProductStatisticsController {

    @Resource
    private WwdxMerchantProductStatisticsServiceI wwdxMerchantProductStatisticsService;

    @RequestMapping("/list")
    public ModelAndView list(WwdxMerchantProductStatisticsModel model,
                             @RequestParam(value = "page", defaultValue = "1") Integer page,
                             @RequestParam(value = "rows", defaultValue = "10") Integer rows) {

        ModelAndView mv = new ModelAndView();
        mv.addObject("listSize",  wwdxMerchantProductStatisticsService.selectModelCount(model));
        mv.addObject("list", wwdxMerchantProductStatisticsService.selectModelList(model,page,rows));
        mv.addObject("model",model);
        return mv;
    }
}
